<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>02-ajaxStart和ajaxComplete</title>
		<style>
			.mask {
				background-color: aqua;
				/* width: 1000px;
				height: 1000px; */
				/* display: none; */
			}
		</style>
		<script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
		<script>
			$(document).ready(function() {
				$(".json").click(function() {
					// 开启
					$.ajax({
						url: "http://47.107.100.125:8080/api/home/getAgreement",
						type: "get",
						success: function(data) {
							console.log(data);
						}

					});

				})
				$(document).ajaxStart(function() {
					$(".mask").html("<p>hello world</p>");
				});
				// $(document).ajaxComplete(function() {
				// 	$(".mask").hide(1000);
				// });
			})
		</script>
	</head>
	<body>
		<button class="json">获取json</button>
		<button class="xml">获取xml</button>
		<div class="mask"></div>
	</body>
</html>
